import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  CreateDateColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity('sys_dict')
export class SysDict {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ name: 'key', comment: '系统字典key' })
  key: string;

  @Column({ type: 'text', name: 'value', comment: '系统字典value' })
  value: string;

  @Column({ type: 'text', name: 'desc', comment: '功能描述' })
  desc: string;

  @CreateDateColumn({
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP(6)',
  })
  created_at: Date;

  @UpdateDateColumn({
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP(6)',
    onUpdate: 'CURRENT_TIMESTAMP(6)',
  })
  updated_at: Date;
}
